import { IsNotEmpty, MaxLength } from 'class-validator';

export class CreatePostDto {
  @IsNotEmpty({ message: '标题不能为空' })
  @MaxLength(20, { message: '标题长度不能超过20个字符' })
  title: string;

  @IsNotEmpty({ message: '内容不能为空' })
  content: string;

  @IsNotEmpty({ message: '图片不能为空' })
  img: string;

  @IsNotEmpty({ message: '分类不能为空' })
  categoryId: string;
}
